/*
 * @Author: hucc
 * @Date: 2021-09-26 11:09:46
 * @LastEditors: hucc
 * @LastEditTime: 2021-09-26 15:52:51
 * @Description: 
 */

//Object.keys()
//Object.values()
//Object.entries()
let obj1 = {
    name: "zs",
    age: 12,
    gender: "male"
}
let keys = Object.keys(obj1);
let values = Object.values(obj1);
let entries = Object.entries(obj1);
console.log(keys, values, entries); //[ 'name', 'age', 'gender' ]  [ 'zs', 12, 'male' ] [ [ 'name', 'zs' ], [ 'age', 12 ], [ 'gender', 'male' ] ]
entries.forEach((item, index) => {
    console.log(item[0], item[1]); //name zs  age 12 gender male

})
let arr = [1, 2, 3, 4, 5]
arr.forEach((item, index) => {
    console.log(item, index);
})